<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>积分后台管理</title>
		<link rel="icon" href="img/lei_huiyuan_on.png"  size="16x16" />
	</head>
	<body>
		<div id="top">
	
		</div>


		<div class="body content"  id="app">
			<div id="left">

			</div>

			<div class="right">

				<div class="liebie_title style_hei_16">
					<img src="img/xiugai.png">修改密码
				</div>

				<div class="bottom">



					<div class="zijin_zhuru_top style_hei_14">
					    <div class="zijin_zhuru_list zijin_zhuru_list_daili">
					        <p>手机号：</p>{{user.username}}
					    </div>
					     <div class="zijin_zhuru_list zijin_zhuru_list_daili">
					         <p>原密码：</p> <input type="text" name="oldPassword" value="" placeholder="请输入" />
					     </div>
					    <div class="zijin_zhuru_list zijin_zhuru_list_daili">
					        <p>修改密码：</p> <input type="text" name="newPassword" value="" placeholder="请输入" />
					    </div>
					    <div class="queren_tijiao " @click="tijiao()">
					        确定
					    </div>
					</div>




				</div>
			</div>
		</div>





		 


		<script src="js/jquery-3.4.1.min.js" type="text/javascript" charset="utf-8"></script>
		<script src="layer/layer.js" type="text/javascript" charset="utf-8"></script>
		<script src="js/selectFilter.js" type="text/javascript" charset="utf-8"></script>
		<script src="js/gong.js"></script>
		<script src="js/fengzhuang.js"></script>
		<script src="js/vue.js"></script>
		<script>
			var app = new Vue({
			    el: '#app',
			    data:{
					user:''
			    },
				mounted(){
					this.get_user()
				},
				methods:{
					xuanye(page){
						this.page=page
						this.get_list()
					},
					get_user(){
						$.ajaxDirect("/api/getUserInfo",'get',{
							
						},
						 (obj)=> {
								  if(obj.code==200){
									  
									   this.user=obj.user
									   
						
								  }
						},
						(err)=> {
						        
								layer.msg(err.message)
						})
					},
					tijiao(){
						var oldPassword=$('input[name="oldPassword"]').val()
						var newPassword=$('input[name="newPassword"]').val()
						
						$.ajaxDirect("/api/changePassword",'post',{
							oldPassword:oldPassword,
							newPassword:newPassword
						},
						 (obj)=> {
								  if(obj.code==200){
									  
									   layer.msg(obj.message)
									   setTimeout(()=>{
										   history.go(0);
									   },500)
									   
						
								  }
						},
						(err)=> {
						        //发送失败
								
								layer.msg(err.message)
						})
					}
			
				}
			})	
		</script>

	</body>
</html>
